package cn.txun05.csmall.passport.security;

import lombok.Data;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

//@Data  此处不能加@Data注解。此注解会给当前类添加无参构造，而超类User没有无参构造
public class AdminDetails extends User {
    @Getter
    private Long  id;
    public AdminDetails(Long id,String username,
                        String password,
                        boolean enabled,
                        Collection<GrantedAuthority> authorities) {
        super(username, password, enabled,
                true, true,
                true, authorities);
        this.id = id;
    }
}
